package com.ls.blog.utils;

/**
 * @program: myblog
 * @author: lishun
 * @create: 2021-06-29 21:54
 **/


import com.ls.blog.result.JsonResult;
import com.ls.blog.result.ResultCode;
public class ResultTool {
    public static JsonResult success() {
        return new JsonResult(true);
    }

    public static JsonResult success(ResultCode resultEnum){
        return new JsonResult(resultEnum);
    }

    public static <T> JsonResult<T> success(ResultCode resultEnum,T data){
        return new JsonResult(resultEnum,data);
    }

    public static <T> JsonResult<T> success(T data) {
        return new JsonResult(true, data);
    }

    public static JsonResult fail() {
        return new JsonResult(false);
    }

    public static JsonResult fail(ResultCode resultEnum) {
        return new JsonResult(false, resultEnum);
    }

}

